home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16267 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: news.corp.sgi.com!user
  2. From: sandvik@sgi.com (Kent Sandvik)
  3. Newsgroups: comp.sys.sgi.apps,comp.lang.c++
  4. Subject: Re: SGI's C++ compiler and the boolean type
  5. Date: Tue, 09 Apr 1996 16:51:51 -0800
  6. Organization: Silicon Graphics, Inc.
  7. Message-ID: <AD90462796682652E@mac-sandvik.engr.sgi.com>
  8. References: <4kefm7$oao@ncar.ucar.edu>
  9. NNTP-Posting-Host: mac-sandvik.engr.sgi.com
  10.  
  11. In article <4kefm7$oao@ncar.ucar.edu>,
  12. jadams@sage.cgd.ucar.edu (James Adams) wrote:
  13.   >    I have begun using SGI's C++ compiler (Translator 4.0) since
  14.   >I want to use their CASEVision debugger.  I have previously used g++
  15.   >to do my compilation, and it correctly interpreted the "bool" type
  16.   >without any problems.  However now that I am using SGI's compiler I
  17.   >get all kinds of compiler errors whenever it encounters "bool", "true",
  18.   >or "false" in my codes.  The only workaround I've been able to come up
  19.   >with is to include the following lines in my header file:
  20.   >
  21.   >typedef int     bool;
  22.   >#define true    1
  23.   >#define false   0
  24.   
  25. bool is a fairly new ANSI C++ draft proposal keyword; I wish someone would
  26. finally finish the ANSI C++ specs, seems to drag on and on...
  27.  
  28. Anyway, the keyword is supported starting with the 6.2 compilers, chapter 3
  29. of the forthcoming 6.2 release notes have information about what's new,
  30. including support for bool and wchar_t types. Meanwhile you could use the
  31. trick you are using above.
  32.  
  33. Note that when bool is used in the 6.2 compilers, true and false will be
  34. reserved keywords. The compiler will also then predefine a macro called
  35. _BOOL, so you could use this label as well.
  36.  
  37. --Kent
  38.  
  39.  
  40.           Kent Sandvik, Silicon Graphics, Inc.    Member of Technical Staff
  41.                              Email: sandvik@sgi.com  Phone: +1 415 933-6417
  42.                     http://reality.sgi.com/sandvik/  (sgi http:/kent.engr/)
  43.                                              "May all developers be happy."
  44.